package cn.iocoder.yudao.module.resource.controller.admin.advertisement.vo;

import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
import cn.iocoder.yudao.framework.common.validation.InEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.math.BigDecimal;
import java.time.LocalDateTime;

import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;

@Schema(description = "管理后台 - 广告创建/修改 Request VO")
@Data
public class ResourceAdvertisementSaveReqVO {

    @Schema(description = "广告ID", example = "1024")
    private Long id;

    @Schema(description = "广告商ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1001")
    @NotNull(message = "广告商ID不能为空")
    private Long advertiserId;

    @Schema(description = "广告标题", requiredMode = Schema.RequiredMode.REQUIRED, example = "新品上市")
    @NotBlank(message = "广告标题不能为空")
    @Size(max = 200, message = "广告标题长度不能超过200个字符")
    private String title;

    @Schema(description = "广告类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotNull(message = "广告类型不能为空")
    private Integer type;

    @Schema(description = "视频URL", example = "https://example.com/ad.mp4")
    @Size(max = 500, message = "视频URL长度不能超过500个字符")
    private String videoUrl;

    @Schema(description = "视频时长（秒）", example = "30")
    private Integer duration;

    @Schema(description = "点击跳转URL", example = "https://example.com")
    @Size(max = 500, message = "点击跳转URL长度不能超过500个字符")
    private String clickUrl;

    @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotNull(message = "状态不能为空")
    @InEnum(value = CommonStatusEnum.class, message = "状态必须是 {value}")
    private Integer status;

    @Schema(description = "开始时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "开始时间不能为空")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime startTime;

    @Schema(description = "结束时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "结束时间不能为空")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private LocalDateTime endTime;

    @Schema(description = "日预算（元）", example = "100.00")
    private BigDecimal dailyBudget;

    @Schema(description = "总预算（元）", example = "10000.00")
    private BigDecimal totalBudget;

}
